#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	double t, T;
	int hour, min;
	scanf("%d %d", &hour, &min);
	t = hour + min/60.0;
	T = 4 * t * t / (t + 2) - 20;
	printf("%lf", T);
	return 0;
}